import * as types from './store/action.types'

// redux 相关
import {
  useSelector,
  useDispatch,
} from 'react-redux'
function Counter() {
  const dispatch = useDispatch()
  const number = useSelector(state => state.number)

  return <div>
    <p>Counter --- {number}</p>
    <button onClick={() => dispatch({type: types.ADD})}>+</button>
    <button onClick={() => dispatch({type: types.ASYNC_ADD})}>async +</button>
    <button onClick={() => dispatch({type: types.STOP_ADD})}>stop +</button>
  </div>
}

export default Counter
